	/**
	 *设置显示图片框的大小
	 */
	function setInitDiv(){
		$("div[class='owl-item']").each(function(index,domEle){
			var i = this.style;
			$(domEle).css({"width":screenWidth,"height":screenHeight});
		});
	}
	/**
	 * 处理图片显示高度与宽度
	 * @param {Object} obj
	 * @param {Object} id
	 * @memberOf {TypeName} 
	 */
	function setInitImg(obj,id){
		$("img[name='img']").each(function(){
			var img = new Image();
			var imgH = this.height;
			var imgW = this.width;
			var id = this.id;
			
			// 鼠标事件函数方式  暂未做完    
			//$('#'+id).mousewheel(function(event, delta) {    
			//    f_mousewheel(event, delta);    
			//}); 
			
			img.src = this.href;
			img.onload=function(){
				var wh = imageTool.setImgAutoHW(img.height,img.width,id,screenWidth,screenHeight);
				var w = wh.split(",")[0];
				var h = wh.split(",")[1];
				setImgSpan(id+"_span",w,h);
				if(currentPage == id){
					showImg(id);
				}
			}
	   });
	}

	function setImgSpan(id,w,h){
		$("#"+id).width(w-10);
		var left = (screenWidth-w)/2
		$("#"+id).css("margin-left",left);
		$("#"+id).css("margin-top",(h-30));
		
		var tm = $("#"+id).html();
		var size = Math.floor((w-30)/16);
		if(tm.length > size){
			$("#"+id).html(tm.substring(0,size)+"...");
		}
		
	}
	/**
	 * 设置图片显示
	 */ 	
	function showImg(id){
		seeArchivesDetailed_hide();
		currentPage = id;
		setShowPage(id);
		$("a[name='img_a']").each(function(index,domEle){
			var a_id = domEle.id;
			$("#"+a_id).css("display","none");
			if(a_id == (id+"_a")){
				$("#"+a_id).css("display","block");
			}
		});
		top.hideMask();
	}
	/**
	 * 设置当前图片显示下面的小黄点
	 **/ 
	function setShowPage(id){
		$("div[name='page_div']").each(function(index,domEle){
			var a_id = domEle.id;
			$("#"+a_id).css("backgroundImage","url("+webPath+"/images/pic-icon.png)"); 
			if(a_id == (id+"_page")){
				$("#"+a_id).css("backgroundImage","url("+webPath+"/images/pic-icon-yellow.png)"); 
			}
		});
	}
	/**
	 *上一张
	 **/
	function upPage(){
		for(var i=0; i<ids.length; i++){
			if(ids[i] == currentPage){
				if(i != 0){
					top.showMask();
					currentPage = ids[i-1];
					showImg(currentPage)
				}else {
					againLoadUpPage();
				}
				return;
			}
		}
	}
	/**
	 * 下一张
	 * */
	function nextPage(){
		for(var i=0; i<ids.length; i++){
			if(ids[i] == currentPage){
				if((i+1) != (ids.length)){
					top.showMask();
					currentPage = ids[(i+1)];
					showImg(currentPage)
				}else {
					againLoadNextPage();
				}
				return;
			}
		}
	}
	/**
	 * 再次加载下一页
	 * @return {TypeName} 
	 */
	function againLoadNextPage(){
		seeArchivesDetailed_hide();
		if(pageNo >= pageCount || openType=="qt"){
			pageNo = pageCount;
			top.zDragTool.alert({text:"已经最后一页最后一张!"});
			return;
		}else{
			top.showMask();
			pageNo ++;
			var url = top.CURRENT_ACTION+where+"&pageSize="+pageSize+"&pageNo="+pageNo+"&type=next";
			window.location = url;
		}
	}
	/**
	 * 再次加载上一页
	 * @return {TypeName} 
	 */
	function againLoadUpPage(){
		seeArchivesDetailed_hide();
		if(pageNo <= 1 || openType=="qt"){
			pageNo = 1;
			top.zDragTool.alert({text:"已经是第一页第一张!"});
			return;
		}else{
			top.showMask();
			pageNo--;
			var url = top.CURRENT_ACTION+where+"&pageSize="+pageSize+"&pageNo="+pageNo+"&type=up";
			window.location = url;
		}
	}
	
	/**
	 * 获取详细时内容
	 * @param {Object} id
	 */
	function getArchivesDetailed(id,imgId){
		if($("#Detailed_div").length<=0){
			var w = $("#"+imgId).width()-8;
			var h = $("#"+imgId).height()-31;
			if(w < 800){w = 800};
			var left = (screenWidth-w-10)/2;
			$("body").append("<div id='Detailed_div' style='width:"+w+"px;margin-left:"+left+"px;top:-"+h+"px;'></div>");
		}else {
			if(parseInt($("#Detailed_div").css("top")) == 0){
				seeArchivesDetailed_hide();
				return;
			}
			var w = $("#"+imgId).width()-8;
			var h = $("#"+imgId).height()-31;
			if(w < 800){w = 800};
			var left = (screenWidth-w-10)/2;
			$("#Detailed_div").css("width",w);
			//$("#Detailed_div").css("height",h);
			$("#Detailed_div").css("margin-left",left);
		}
		var url = top.CURRENT_ACTION+"?method=getArchivesDetailed&code="+top.ITool.IMG_CODE+"&id="+id;
		var success = seeArchivesDetailed;
		var option = top.getAjaxOption({url:url,success:success});
		$.ajax(option);
	}
	/**
	 * 查看详细时设置内容
	 * @param {Object} msg
	 */
	function seeArchivesDetailed(msg){
		if(msg != "0"){
			msg = eval("("+msg+")");
			var str = "<table style='margin-left: auto;margin-right: auto;'>";
			var tr = "<tr><th>题名:</th><td colspan='3'>"+top.objToStr(msg.ZTM)+"</td></tr>";
			tr += "<tr><th>分类号:</th><td>"+top.objToStr(msg.ARCHIVES_TYPE)+"</td><th>件号:</th><td>"+top.objToStr(msg.JH)+"</td></tr>";
			tr += "<tr><th>保存期限:</th><td>"+top.objToStr(msg.BGQX)+"</td><th>责任者:</th><td>"+top.objToStr(msg.ZRZ)+"</td></tr>";
			tr += "<tr><th>拍摄时间:</th><td>"+top.objToStr(msg.PHOTO_DATE)+"</td><th>拍摄者:</th><td>"+top.objToStr(msg.PHOTO_GRAPHER)+"</td></tr>";
			tr += "<tr><th>年度:</th><td>"+top.objToStr(msg.ND)+"</td><th></th><td></td></tr>";
			tr += "<tr><th>备注:</th><td colspan='3'>"+top.objToStr(msg.REMARK)+"</td></tr>";
			tr += "<tr><th colspan='4' style='text-align:center;'>" +
			"<a href='javascript:void(0)' onclick='seeArchivesDetailed_hide()'>收&nbsp;起</a></th></tr>";
			str += tr+"</table>";
			$("#Detailed_div").html(str);
			seeArchivesDetailed_show();
		}
	}
	/**
	 * 显示DIV
	 */
	function seeArchivesDetailed_show(){
		if($("#Detailed_div").length>0){
			var h = $("#Detailed_div").height();
			$("#Detailed_div").animate({top:'0px'});
		}
		
	}
	/**
	 * 隐藏DIV
	 */
	function seeArchivesDetailed_hide(){
		if($("#Detailed_div").length>0){
			var h = $("#Detailed_div").height();
			$("#Detailed_div").animate({top:'-'+h+'px'});
		}
	}
	/**
	 * 创建显示/显示DIV
	 */
	function f_keyDown(){
		var id = $("#"+currentPage+"_input").attr("name");
		getArchivesDetailed(id,currentPage)
	}
	
	function f_mousewheel(event, delta){
		$("#next_a").html(delta);
	}